package com.atguigu.springcloud.servic.impl;

import com.atguigu.springcloud.dao.PaymentDao;
import com.atguigu.springcloud.entities.Payment;
import com.atguigu.springcloud.servic.PaymentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author: XieHaichuan
 * @create: 2021-07-29 10:54
 **/
@Service
public class PaymentServiceImpl implements PaymentService {

    /**
     * @Resource 是JSR250规范中得注解，可以实现自动装配得功能，但是它是按照组件name进行自动装配
     *           并且不支持配合@Primy注解和@Qualifier注解使用
     */
    @Resource
    private PaymentDao paymentDao;

    @Override
    public int create(Payment payment) {
        return paymentDao.create(payment);
    }

    @Override
    public Payment getPaymentById(Long id) {
        return paymentDao.getPaymentById(id);
    }
}
